import bisect
from typing import List


class Solution:
    def kthSmallestProduct(self, nums1: List[int], nums2: List[int], k: int) -> int:
        # 找到两个数组的分界位置
        pos_arr1_0_right = bisect.bisect_right(nums1, 0)
        pos_arr2_0_right = bisect.bisect_right(nums2, 0)

        def bi_left(arr, target):
            l = 0
            r = len(arr) - 1
            while l <= r:
                mid = (l + r) >> 1
                if arr[mid] < target:
                    l = mid + 1
                else:
                    r = mid - 1
            return l - 1

        pos_arr1_0_left = bi_left(nums1, 0)
        pos_arr2_0_left = bi_left(nums1, 0)
